/*
 * analogtv.h - analog tv interface
 *
 * Copyright (C) 2010-2011 Serge Begger
 *
 * This program is free software: you can redistribute it and/or modify
 * it under the terms of the GNU General Public License as published by
 * the Free Software Foundation, either version 3 of the License, or
 * (at your option) any later version.
 *
 * This program is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 * GNU General Public License for more details.
 *
 * You should have received a copy of the GNU General Public License
 * along with this program.  If not, see <http://www.gnu.org/licenses/>.
 */

#ifndef ANALOGTV_H
#define ANALOGTV_H

#include <QWidget>
#include <QSettings>
#include "qcarpcdialog.h"
#include "gstengine.h"

namespace Ui {
    class analogtv;
}

class analogtv : public QWidget
{
    Q_OBJECT

public:
    explicit analogtv(QWidget *parent = 0);
    ~analogtv();
    bool init();
    gstengine *gstEngine;
    int currVolume;
    void setVolume(int);

private:
    Ui::analogtv *ui;

    QStringList chlist;
    QList<int> *presetList;
    QTimer *scanTimer;
    void initChList();
    void loadPreset();
    void savePreset();
    int currCh;
    int currPreset;
    int currSignal;
    void setChannel();

    void initVideo(QString);
    numPanel *chPanel;

    QSettings *settings;

signals:
    void hideWidget();

private slots:
    void on_backButton_pressed();
    void on_closeButton_pressed();
    void on_findButton_pressed();
    void on_chButton_pressed();
    void on_prevButton_pressed();
    void on_nextButton_pressed();
    void updateUiCh();
    void setManCh();
    void scanCh();
    void setPresetCh();
};

#endif // ANALOGTV_H
